home *** CD-ROM | disk | FTP | other *** search
- #include "speech.proto.h"
- #include "errors.proto.h"
- #include "telneterrors.h"
- #include <Errors.h>
- #include <TextUtils.h>
-
-
- OSErr gSpeechErrors[] = {
- noErr, /* No error */
- paramErr, /* Parameter error */
- memFullErr, /* Not enough memory to speak */
- nilHandleErr, /* Handle argument is NIL */
- siUnknownInfoType, /* Feature not implemented on synthesizer */
- noSynthFound, /* Could not find the specified speech synthesizer */
- synthOpenFailed, /* Could not open another speech synthesizer channel */
- synthNotReady, /* Speech synthesizer is still busy speaking */
- bufTooSmall, /* Output buffer is too small to hold result */
- voiceNotFound, /* Voice resource not found */
- incompatibleVoice, /* Specified voice cannot be used with synthesizer */
- badDictFormat, /* Pronunciation dictionary format error */
- badInputText, /* Raw phoneme text contains invalid characters */
- -248, /* Unimplemented message */
- -250, /* Specified voice has not been preloaded */
- -252, /* Incorrect number of embedded command arguments */
- invalidComponentID, /* Speech channel is uninitialized or bad */
- 0, /* other error */
- };
-
-
- void DoSpeechError(OSErr err)
- {
- short e;
- Str255 errorMessage;
-
- /* use the last error as a sentinel, so the loop is guaranteed to terminate */
-
- gSpeechErrors[sizeof(gSpeechErrors)/sizeof(*gSpeechErrors)] = err;
-
- /* Find the correct index, which is 1 + array index */
-
- e = 0;
- while (err != gSpeechErrors[e++]) {
- }
-
- /* Get the string */
-
- GetIndString(errorMessage, kSpeechIndStringId, e);
-
- /* And do the error */
-
- p2cstr(errorMessage);
- DoError(NOCODE, LEVEL2, (char *)errorMessage);
- }
-